Skip to main content

More right-solid
SHOW DETAILS
up-solid down-solid
eye
Title
Date Published
Creator
Community Video
Sep 3, 2019 David Fifield
movies
eye 11
favorite 0
comment 0
In this episode, we write Python and Go programs to extract a graph of level connectivity, and start writing a Rust version. graph.py.dot graph.go.dot graph.png The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e01
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Go, Python, Rust, Graphviz
Community Video
Sep 6, 2019 David Fifield
movies
eye 7
favorite 0
comment 0
In this episode, we enhance the Python and Go graph extractor programs, experiment with different Graphviz settings, finish the Rust graph extractor program, and produce a first randomized, though unbeatable, executable. graph.py.dot graph.rs.dot rando.exe Around 1:13:00, where I comment on the loudness of the game sounds, I edited the audio after recording to make it quieter. The "Desktop Audio" slider in OBS was actually working, but I couldn't hear the difference in my headphones....
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Python, Go, Rust, Graphviz
Community Video
Sep 21, 2019 David Fifield
movies
eye 17
favorite 0
comment 0
We begin sketching out both a machine-readable and a visual directed graph of location connectivity, annotated with inventory requirements on each edge. We start reverse-engineering the game executable, annotating many interesting variables and functions, and extract graphics for some of the inventory items. graph.py hacked to show door coordinates graph.py.dot , Graphviz source with door coordinates graph.png , graph including door coordinates digraph.svg , beginning of a manually created game...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Python, Rust, Graphviz,...
Community Video
Sep 28, 2019 David Fifield
movies
eye 10
favorite 0
comment 0
We find a better way to lay out a visual game map by using Graphviz node attributes. Then we work out a graph data structure and start working on simple algorithms to traverse it. graph.tmp.dot , manually edited graph to adjust coordinates and include stage bitmaps graph.png , visualization of graph.tmp.dot tmp.dot , output of Rust digraph code tmp.png , visualization of tmp.dot The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz
Community Video
Oct 4, 2019 David Fifield
movies
eye 4
favorite 0
comment 0
We refactor the graph data structures and define data types for inventory items and the player's current inventory. Using these, we begin to construct and traverse a "virtual graph" whose vertices are (location, inventory) state tuples, and whose edges are the edges that are possible given the inventory in the current state. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz, Inkscape
Community Video
Oct 18, 2019 David Fifield
movies
eye 19
favorite 0
comment 0
We continue defining the randomizer logic, getting through the connectivity of the lake and space stages. We take a detour to do some reverse engineering of the executable and program in some cheats (infinite lives, infinite health, item toggle) to assist in exploration. cheat.exe rando.dot rando.png The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e06
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz, reverse...
Community Video
Oct 26, 2019 David Fifield
movies
eye 7
favorite 0
comment 0
We change tack on defining the logic graph, first generating an outline automatically using information in the executable, then manually refining it. We get the whole graph fleshed out, except for a couple of TODOs, and possible errors. autogen-logic.go cheat.exe , now gives lantern too rando.dot rando.png The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Go, Rust, Graphviz, reverse...
Community Video
Oct 29, 2019 David Fifield
movies
eye 11
favorite 0
comment 0
This episode is spent in refining and refactoring the logic graph. We start to split the program into more modules, but retreat from that after encountering some language-level obstacles. rando.dot rando.png The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e08
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz
Community Video
Nov 8, 2019 David Fifield
movies
eye 7
favorite 0
comment 0
We start with some refactorings that resisted us last time: returning an iterator from a function and using multiple mutually referential modules. Using rustup , we install rustfmt and Clippy , then ignore most of their recommendations. We then write a working draft of an item assignment validity checker and use it to generate a winnable randomized game. rando.exe spoiler.txt screenshot.gif The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this:...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustup, rustfmt, Clippy
Community Video
Nov 16, 2019 David Fifield
movies
eye 22
favorite 0
comment 0
We begin by modifying the check_validity function to report the shortest winning (or softlocking) path, not just any old path. One subtlety I didn't mention: our shortest-path algorithm doesn't need a relaxation step (where we find that an alternate path to a given node is shorter than another path we already knew for it) because the state transition graph satisfies the triangle inequality. Because we are counting hops, it is as if all edge weights are equal to 1. Then we consider options for...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Sage, shortest path,...
Community Video
Nov 23, 2019 David Fifield
movies
eye 1
favorite 0
comment 0
This episode was spent in fixing bugs in the logic graph, writing logic tests, and documenting design choices that relate to logic. We leave in an arguable softlock in shed0, because it exists in the vanilla item assignment and is nearly impossible to avoid in any case. We remove the possibility of softlock in castle2, although not without reservations, because doing so reduces the fraction of valid seeds from about 9% to about 1.5%, particularly constraining where the lantern may be located in...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust
Community Video
Nov 30, 2019 David Fifield
movies
eye 2
favorite 0
comment 0
We work on the command-line interface of the program, allowing it to run meaningfully with 0, 1, or 2 command-line filenames. We define a Seed data type and an external string encoding for seeds. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e12
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Clippy
Community Video
Dec 8, 2019 David Fifield
movies
eye 1
favorite 0
comment 0
We modify the check_validity function to return both a winnable path (if one exists) and a softlock path (if one exists). Formerly, whenever there was a softlock, the program would report "no winning path". Now it will report a winning path along with a softlock path. The remainder of the time is spent on refactoring, documenting, and writing tests for the seed module. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustfmt
Community Video
Dec 14, 2019 David Fifield
movies
eye 1
favorite 0
comment 0
We first fix a bug introduced last time, where we made the inner type of seed::Seed usize rather than u64 . A seed needs be large enough to hold one of our permutation multiset ranks, which may be up to about 47 bits. We document and polish the seed module. The rest of the time, we write EXE format reading and writing routines, towards automatic EXEPACK decompression of the input file. We refer to a previous implementation of EXEPACK, though aiming to make the implementation better than it was...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, EXE file format, EXEPACK
Community Video
Dec 21, 2019 David Fifield
movies
eye 9
favorite 0
comment 0
We start by praising the virtues of the book Programming Rust and taking a quick look at a mod of Captain Comic called The Adventures of Pioneer Ksenia . The rest is refactoring and writing tests for the seed and exe modules, finding a couple of bugs. We also commit to some seeds for blind play testing comparison between the logic that forbids a softlock in castle2 and the one that does not. No-softlock seeds: 111DE1A010B0C 111C7B568622B 1640A870B141B Softlock-possible seeds: 14037F0D841AC...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Programming Rust, The...
Community Video
Jan 19, 2020 David Fifield
movies
eye 5
favorite 0
comment 0
We do a little touch-up refactoring and then dive into writing an EXEPACK decompressor. We get as far as finishing a draft of all the container-related aspects of the decompressor, but stop before writing the main decompression loop. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e16
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Programming Rust, EXE...
Community Video
Jan 25, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
We finish up the EXEPACK decompressor and write a few tests. Now the randomizer works on an unmodified original COMIC.EXE. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e17
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, EXEPACK
Community Video
Feb 1, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
We make the randomizer work do input and output of entire game directories, not just the single comic.exe file. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e18
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, FAT, crates.io,...
Community Video
Feb 8, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
This time we write functions to encode and decode RLE data as used in Comic's .EGA files, and to blit graphics to a buffer representing EGA data, with the aim of burning the seed into the runtime graphics. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e19
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, EGA, run-length encoding
Community Video
Feb 16, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
In this episode we improve the RLE encoder to avoid a buffer overflow in COMIC.EXE, design a font and cause the seed to be burned into the game graphics, and make the randomizer produce a spoiler log RANDO.DOC among the output files. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e20
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, run-length encoding
Community Video
Feb 19, 2020 David Fifield
movies
eye 4
favorite 0
comment 0
We cause the COMIC.DOC spoiler file to be written with CRLF line endings. We take a digression to discuss the not entirely confidence-inspiring landscape of third-party Rust crates and crate security, then dive into zip input/output using the zip crate. We rewrite the directory-based input/output to be entirely zip-based, with plans to next factor out the differences and allow both input and output to be either a directory or a zip file. The source code is in a repo that uses Git and git-annex...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, object safety, CRLF,...
Community Video
Feb 22, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
In this episode I meant to quickly restore directory input/output to allow the program to work with both directories and zip files. But I got stuck on some language-level issues and instead spent the entire time trying to understand error messages, and didn't produce anything useful in the end. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e22
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust
Community Video
Feb 24, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
In episode 23 we throughly analyze what went wrong in episode 22 and find a decent way to do the dynamic dispatch we were aiming for. The randomizer now can take input from a directory or a zip file, and write output to a directory or to a zip file. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e23
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Zip, dynamic dispatch
Community Video
Feb 29, 2020 David Fifield
movies
eye 4
favorite 0
comment 0
In this episode we take care of a bunch of lingering small agenda items: Prefer Vec::truncate over Vec::resize when possible. Use for bare URL links in documentation. Use map_err(|err| From::from(err)) in place of or_else(|err| Err(From::from(err))) . Use Self in impl s wherever possible. Change some patterns for compatibility with rustc 1.34. Allow the EXE relocations table offset to be anywhere, when the number of relocations is 0. Simplify crlf::Writer so it doesn't need an internal buffer....
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustdoc, Markdown,...
Community Video
Mar 6, 2020 David Fifield
movies
eye 4
favorite 0
comment 0
We factor the comicrando program out into a library and a main program, then start a new map program. We dither for a while about how best to generate the positions of locations in the map program, and then struggle for a while with Graphviz layout problems. hack.go , code generator for the map program The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e25
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz, Structure and...
Community Video
Mar 15, 2020 David Fifield
movies
eye 7
favorite 0
comment 0
We work through some Graphviz troubles and finish the program to generate a visual game map. map.png , map graphic hack.go , code generator for the map program The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e26
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Graphviz
Community Video
Mar 23, 2020 David Fifield
movies
eye 15
favorite 0
comment 0
This episode is dedicated to analyzing two versions of the logic: one that forbids a softlock in castle2 and one that permits it. In the course of testing, we discover a logic bug (some missing connections), coincidentally also in castle2, that roughly triple the number of valid seed in the softlock-forbidden case. With the bug fixed, it's less clear that anything needs to be done to work around the castle2 softlock. We produce a number of graphs but defer the decision about what to do until...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, R, ggplot2, CSV
Community Video
Mar 29, 2020 David Fifield
movies
eye 14
favorite 0
comment 0
We do a location-by-location audit of the logic graph. We don't find any serious bugs like the one in the previous episode, and make only a few minor changes. We finally decide not to add in an extra edge in castle2, judging the logic without it to produce seeds that are diverse enough. locs.png , map of locations without edges map.png , revised map graphic valid.pdf , revised comparison of what seeds are valid under both logics winnable_path_length.pdf , revised histogram of shortest winning...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, R, ggplot2, CSV
Community Video
Apr 4, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
This episode is devoted to getting started with WebAssembly . We start with a brief investigation into how to load a local file in JavaScript, manipulate it, and make the modified file downloadable. After that, we learn how to use wasm-pack to compile a "hello, world" library and call into Rust code from JavaScript. The process doesn't go exactly according to the documentation, but we get something working in the end. Finally we apply wasm-pack to the comicrando library crate, and get...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, HTML, JavaScript, Rust,...
Community Video
Apr 9, 2020 David Fifield
movies
eye 3
favorite 0
comment 0
We start by answering a couple of questions left over from last time. The n suffix on a JavaScript numeric literal indicates the BigInt type, which is how wasm-bindgen represents u64 . The technique we arrived at last time to instantiate wasm-pack output is actually documented , but in the wasm-bindgen docs, not the wasm-pack docs. We make it so that non-Wasm compiles don't require the wasm-bindgen crate, and downgrade wasm-bindgen in the Cargo lock file to keep its dependencies working with...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, HTML, JavaScript, Rust,...
Community Video
Apr 21, 2020 David Fifield
movies
eye 3
favorite 0
comment 0
In this episode we add cheat / challenge modes (infinite lives, infinite HP, no Cola, no Shields) and a Pioneer Ksenia avatar. pkg.zip , wasm-pack output along with an HTML and JavaScript driver The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e31
Topics: The Adventures of Captain Comic, The Adventures of Pioneer Ksenia, live coding, randomizer, DOS...
Community Video
Apr 28, 2020 David Fifield
movies
eye 4
favorite 0
comment 0
We introduce a new "blinded" format for seeds that makes it harder to infer items locations using mental arithmetic. The core idea is a permutation of integers induced by a the cyclic group of integers modulo n . In our case, n is 1 greater than the number of item assignments and happens to be a prime, so the group of integers modulo n is cyclic and has order equal to the number of item assignments. The group gives us a permutation of integers representing item assignments, one not...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, Sage, cyclic group,...
Community Video
May 5, 2020 David Fifield
movies
eye 0
favorite 0
comment 0
We add spoiler output to the web interface and make miscellaneous other small changes. pkg.zip , wasm-pack output along with an HTML and JavaScript driver The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e33
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, WebAssembly, Wasm, HTML,...
Community Video
May 9, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
We handle the omission of items from the web spoiler in no-Cola and no-Shields modes; add permalinks to the web interface; and check the checksums of input files. pkg.zip , wasm-pack output along with an HTML and JavaScript driver The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex get git checkout e34
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, WebAssembly, Wasm, HTML,...
Community Video
May 15, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
In this episode, we write a custom pseudorandom number generator based on iterated SHA-256, and add a "seed seed" interface to initialize the PRNG for generating seeds. With this feature we add a "daily run" to the web interface by initializing the PRNG with the current date. pkg.zip , wasm-pack output along with an HTML and JavaScript driver The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, WebAssembly, HTML,...
Community Video
May 24, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
We take care of a few small features and bugfixes. Make web permalinks refer to the seed of the generated zip. Let the command-line version run with --seed-seed and no input file, the same as with --seed . Set last-modified dates on files in directory output, just as in zip output. We make some progress on having the command-line version write to a temporary directory/file and delete it if there is a runtime error, but decide that the topic needs to be revisited. pkg.zip , wasm-pack output...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, WebAssembly, HTML,...
Community Video
Jun 1, 2020 David Fifield
movies
eye 4
favorite 0
comment 0
We first revert a logic change made back in episode 27 . You can exit castle0 without picking up the item in forest0. You have to be facing to the right before you open the door, and holding right as you exit. map.svg , updated logic graph map The rest of the episode is devoted to writing rustdoc for all the modules except the main programs, along with some light refactoring and code improvements. The source code is in a repo that uses Git and git-annex . To follow along in the source code, do...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustdoc, Sage, George...
Community Video
Jun 13, 2020 David Fifield
movies
eye 2
favorite 0
comment 0
This episode is mostly devoted to documentation. We make the web interface handle no-JavaScript and no-WebAssembly cases. We write a man page, a README, and rustdoc for the comicrando and map programs. We also fill out a few metadata fields in Cargo.toml. pkg.zip , wasm-pack output along with an HTML and JavaScript driver The source code is in a repo that uses Git and git-annex . To follow along in the source code, do this: git clone https://www.bamsoftware.com/git/comic.git cd comic/ git annex...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustdoc, troff, man...
Community Video
Jun 20, 2020 David Fifield
movies
eye 1
favorite 0
comment 0
In this, the final episode, we take care of some error-handling and polishing tasks. We make the command-line version gracefully report errors. We add error enum s in the exe and exepack modules. We add some more tests to the exe module. We do a final pass of rustfmt and Clippy. Because of a hardware malfunction, the original audio was badly clipped and nigh unintelligible. The audio in the video is a later re-recording of the voice narration. You won't have the comforting keyboard sounds, but...
Topics: The Adventures of Captain Comic, live coding, randomizer, DOS games, Rust, rustfmt, Clippy